package cn.osworks.aos.web.tag.impl.app;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;

import cn.osworks.aos.core.typewrap.Dto;
import cn.osworks.aos.web.tag.core.model.TagDto;

public class HtmlBaseTag extends AppTagSupport {
	private static final long serialVersionUID = 1L;
	private String a;

	public int doStartTag() throws JspException {
		Object localObject1 = new TagDto();
		super.pkgProperties((Dto) localObject1);
		Object localObject2 = this;
		if (!a.endsWith("/"))
			a = a + "/";
		if (!a.startsWith("/"))
			a = "/" + a;
		String str = ((HtmlBaseTag) localObject2).getContextpath() + a;
		localObject2 = (HttpServletRequest) ((HtmlBaseTag) localObject2).pageContext.getRequest();
		localObject2 = ((HttpServletRequest) localObject2).getScheme() + "://"
				+ ((HttpServletRequest) localObject2).getServerName() + ":"
				+ ((HttpServletRequest) localObject2).getServerPort();
		((Dto) localObject1).put("href", str = (String) localObject2 + str);
		localObject1 = mergeFileTemplate("app/htmlBaseTag.vm", (Dto) localObject1);
		try {
			this.pageContext.getOut().write((String) localObject1);
		} catch (IOException localIOException) {
			throw new JspException(localIOException);
		}
		return 0;
	}

	public void release() {
		super.release();
	}

	public String getHref() {
		return this.a;
	}

	public void setHref(String paramString) {
		this.a = paramString;
	}
}
